<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta charset="UTF-8">
<title>图书管理</title>
<jsp:include page="/WEB-INF/include/base.jsp"></jsp:include>
<script type="text/javascript">
	$(function () {
		$(".deleteA").click(function () {
			if(!confirm("确认删除吗？")){
				return false;//取消超链接的默认行为
			}
		});
	});
</script>
</head>
<body>
	
	<div id="header">
			<img class="logo_img" alt="" src="static/img/logo.gif" >
			<span class="wel_word">图书管理系统</span>
			<jsp:include page="/WEB-INF/include/manager_head.jsp"></jsp:include>
	</div>
	
	<div id="main">
		<table>
			<tr>
				<td></td>
				<td>名称</td>
				<td>价格</td>
				<td>作者</td>
				<td>销量</td>
				<td>库存</td>
				<td colspan="2">操作</td>
			</tr>

			<c:forEach items="${requestScope.page.list}" var="book" varStatus="status">
				<tr>
					<td>${pageScope.status.count}</td>
					<td>${pageScope.book.title}</td>
					<td>${pageScope.book.price}</td>
					<td>${pageScope.book.author}</td>
					<td>${pageScope.book.sales}</td>
					<td>${pageScope.book.stock}</td>
					<td><a href="BookManagerServlet?method=toUpdate&id=${pageScope.book.id}">修改</a></td>
					<td><a class="deleteA" href="BookManagerServlet?method=deleteBook&id=${pageScope.book.id}">删除</a></td>
				</tr>
			</c:forEach>

			<tr>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td><a href="pages/manager/book_edit.jsp">添加图书</a></td>
			</tr>	
		</table>

		<jsp:include page="/WEB-INF/include/page.jsp"></jsp:include>
	</div>
	
	<div id="bottom">
		<span>
			尚硅谷书城.Copyright &copy;2015
		</span>
	</div>
</body>
</html>